import { createRouter, createWebHistory } from 'vue-router'
import indexView from '@/views/index/index.vue'
import loginView from '@/views/login/index.vue'
import homeView from '@/views/home/index.vue'


const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'index',
      component: indexView,
    },
    {
      path: '/login',
      name: 'login',
      component: loginView
    },
    {
      path: '/home',
      name: 'home',
      component: homeView
    },
    // {
    //   path: '/about',
    //   name: 'about',
    //   // route level code-splitting
    //   // this generates a separate chunk (About.[hash].js) for this route
    //   // which is lazy-loaded when the route is visited.
    //   component: () => import('../views/AboutView.vue')
    // }
  ]
})
router.beforeEach((to, from, next) => {
  console.log(to, "to");
  console.log(from, "from");
  next()
})
export default router
